package com.lvan.controller.common;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.lvan.bean.BaseException;
import com.lvan.bean.GoodsLog;
import com.lvan.bean.Page;
import com.lvan.controller.BaseController;
import com.lvan.service.interfaze.common.IGoodsLogService;

@Controller
@RequestMapping("/goodslog")
public class GoodsLogController extends BaseController{
	@Autowired
	private IGoodsLogService goodsLogService;
	@RequestMapping(value="/query")
	public String query(ModelMap model,Page page, GoodsLog t, HttpServletRequest request) {
		List<GoodsLog> ls = goodsLogService.query(t, page);
		model.put("data", ls);
		return INDEX;
	}
	
	@RequestMapping(value="/delete")
	public void delete(String id, HttpServletRequest request) throws BaseException {
		this.goodsLogService.delete(id);
	}
	
	@RequestMapping(value="/add")
	public String add(GoodsLog t, HttpServletRequest request) throws BaseException {
		this.goodsLogService.add(t);
		return INDEX;
	}
	
	@RequestMapping(value="/update")
	public String update(GoodsLog t, HttpServletRequest request) throws BaseException {
		this.goodsLogService.update(t);
		return INDEX;
	}
}
